#!/bin/sh

if tty | grep "/dev/tty1"; then
    if ! Hyprland; then
        echo "Something went wrong. Going to console."
    else
        clear
        echo "Closed without errors. Shut down? [Y/n]"
        read -r shutdown
        if [ "$shutdown" = "y" ]; then
            loginctl poweroff
        fi
    fi
fi

